Add node-test-example; run examples via a CI matrix - #16
Merged
Conversation
New examples/node-test-example: a minimal shadow-cljs :node-test + jsdom project (no browser) that runs fully in CI. It demonstrates the setup (deps, node-test build, global-jsdom preload) plus: - app.reagent-test: render!, fire-event (in act), screen, within, mocks - app.plain-react-test: raw createElement, user-event, and async find-by written as native ^:async / await tests Generalize the CI example job into a matrix over the example projects, each invoked via a standard npm run ci script (reagent-karma-example gains one). clj-kondo on npm does not know native await yet, so the new example excludes it from the unresolved-symbol linter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a second example and generalizes the example CI.
examples/node-test-example— a minimal shadow-cljs:node-test+ jsdom project (no browser) that runs fully end-to-end in CI. It shows the setup (deps, node-test build,global-jsdompreload) plus representative usage:app.reagent-test— Reagent:render!,fire-event(wrapped inact),screen,within, andmocks.app.plain-react-test— plain React: rawcreateElement,user-event, and asyncfind-by-*as native^:async/awaittests.CI matrix — the
examplejob now runs over[reagent-karma-example, node-test-example], each invoked via a standardnpm run ciscript (the karma example gains one). Adding future examples is just a matrix entry + aciscript.Note: the clj-kondo release on npm doesn't recognize native
awaityet (the root repo's clj-kondo, from the release action, does), so this example excludesawaitfrom the unresolved-symbol linter.Verified locally: both examples'
npm run cipass (node-test-example: 5 tests / 7 assertions; reagent-karma-example: 3 / 7).